﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="sistemaAcademicoFinanceiroEscolas.DynamicData.CustomPages.valorEspecialGrupo.List" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
<%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>

<%@ Register assembly="Catalyst.Web.DynamicData" namespace="Catalyst.Web.DynamicData" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
    
    <div class="tamanho">

    <h2>Lista de valores especiais para determinados grupos</h2>

    <asp:ScriptManagerProxy runat="server" ID="ScriptManagerProxy1" />

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableClientScript="true"
                HeaderText="Lista de erros de validação" />
            <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" />
       
            <asp:DynamicFilterForm ID="DynamicFilterForm1" runat="server" DataSourceID="GridDataSource">
                    <FilterTemplate> 
                    
                        Grupo
                        
                        <asp:DynamicFilterControl  runat="server" ID="DynamicFilter" DataField="grupo"
                        OnSelectedIndexChanged="OnFilterSelectedIndexChanged" />
                       
                        <asp:Button ID="LinkButton1" runat="server" CommandName="Search" Text="Procurar"></asp:Button><br />
                        
                    </FilterTemplate>
                    </asp:DynamicFilterForm>  
        
        <br />
            
            <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource"
                AllowPaging="True" AllowSorting="True" CssClass="gridview" 
                AutoGenerateColumns="False" OnRowDataBound="RowDataBound">
                <Columns>
                
					<asp:DynamicField DataField="grupo" HeaderText="Grupo "/>
                    <asp:DynamicField DataField="dataInicialValorEspecialGrupo" HeaderText="Data inicial "/>
                    <asp:DynamicField DataField="dataFinalValorEspecialGrupo" HeaderText="Data final "/>
                    <asp:DynamicField DataField="valorValorEspecialGrupo" HeaderText="Valor "/>


                    <asp:TemplateField HeaderText="Ações">
                        
                        <ItemTemplate>
                            
                            
                            <a href="Edit.aspx?codigoValorAula=<%#Eval("codigoValorEspecialGrupo") %>&dataInicial=<%#Eval("dataInicialValorEspecialGrupo") %>&dataFinal=<%#Eval("dataFinalValorEspecialGrupo") %>&aulaValor=<%#Eval("valorValorEspecialGrupo") %>&erro=ok"><img title="Editar" src="<%=Convert.ToString(ConfigurationManager.AppSettings["url"])%>/images/btEditar.gif"/></a>
                                
                                
                            <asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete"
                                CausesValidation="false" Text="Excluir" title="Excluir"
                                OnClientClick='return confirm("Tem certeza que deseja excluir?");'>
                            
                            <img src="<%=ConfigurationManager.AppSettings["url"] %>/images/logo_excluir.png" />
                            
							</asp:LinkButton>    
                                                    
                            
                        </ItemTemplate>
                        
                    </asp:TemplateField>

                </Columns>

                <PagerStyle CssClass="footer"/>        

                <EmptyDataTemplate>
                    Não existem valores cadastrados no sistema.
                </EmptyDataTemplate>
            </asp:GridView>

             <asp:DynamicLinqDataSource ID="GridDataSource" runat="server" ContextTypeName="sistemaAcademicoFinanceiroEscolas.modeloDataContext"
                TableName="valorEspecialGrupos" EnableDelete="True">
            </asp:DynamicLinqDataSource>

            <br />

            <div class="bottomhyperlink">
                <%--<asp:HyperLink ID="InsertHyperLink" runat="server"><img runat="server" src="~/DynamicData/Content/Images/plus.gif" alt="Cadastrar novo valor mensalidade" />&nbsp;Cadastrar nova mensalidade</asp:HyperLink>--%>
                <a href="Insert.aspx?erro=">&nbsp;Cadastrar novo valor</a>
            </div>
            
            
        </ContentTemplate>
    </asp:UpdatePanel>
    
    </div>
    
</asp:Content>